import Sequelize from 'sequelize';
import { getDefaultFields } from '../utils';


module.exports = app => {
	const DataTypes = app.Sequelize;

	const Model = app.model.define('notice', {
		id: {
			type: DataTypes.INTEGER(11),
			allowNull: false,
			primaryKey: true,
			autoIncrement: true
		},
		name: {
			type: DataTypes.STRING(200),
			allowNull: true
		},
		content: {
			type: DataTypes.STRING(255),
			allowNull: true
		},
		status: {
			type: DataTypes.INTEGER(11),
			allowNull: true,
			defaultValue: 1
		},
		...getDefaultFields()
	}, {
		tableName: 'notice',
		timestamps: false
	});
	
	Model.sync({ alter: true });
	Model.associate = function() {

	}

	return Model;
};
